<template>
    <MyNAv/>
    <ProductList :urls="ShopList" :key="ShopList.length" />
    <MyFoot/> 
  </template>
  
  <script lang="ts" setup>
  import MyNAv from '../components/MyNav.vue'
  import ProductList from "@/components/ProductList.vue";
  import MyFoot from '@/components/MyFoot.vue';
import { onMounted, ref } from 'vue';
import { getShopList } from '@/api/api';
// 约束列表数据接口
interface ListType{
        _id:string;
        shopImg:string;
        shopName:string;
        shopPrice:string
    }


  //列表数据
const ShopList=ref<ListType[]>([])
onMounted(async () => {
    let res:any= await getShopList()
    // console.log(res.data.data);    
    ShopList.value = [...ShopList.value,...res.data.data]  
    
    
})







  </script>
  
